package com.tc.jaskson.controller;

import com.tc.jaskson.entity.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.Date;

/**
 * @author :silence
 * @version :
 * @description
 * @date :2020/8/11 9:53
 */
@Controller
public class LoginController {


    @GetMapping("/user/{id}")
    @ResponseBody
    public User findUser(@PathVariable("id") int id){

        User user=new User(id,"张三","1223",new Date(),"你好");
        return user;
    }

    @PostMapping("/user")
    @ResponseBody
    public User findUser(@RequestBody User user){
        return user;
    }


}
